Skip to content

Move invite URL generation to on_ready event#175

Merged
CarrotManMatt merged 5 commits into
CSSUoB:mainfrom
edwinchan129:move-invite-URL-Generation
Apr 21, 2024
Merged

Move invite URL generation to on_ready event#175
CarrotManMatt merged 5 commits into
CSSUoB:mainfrom
edwinchan129:move-invite-URL-Generation

Conversation

@edwinchan129

Copy link
Copy Markdown
Contributor

Moved invite URL generation to global function within utils/generate_invite_url.py. Deleted utils/main.py and utils/base_utility_function.py. Removed main() from utils/init.py.
Moved call to generate_invite_url() to startup.py.
- If main guild not set, invite URL will be outputted and bot will be shutdown.
- If main guild is set, invite URL will only be outputted if CONSOLE_LOG_LEVEL in environment variable set to DEBUG.
I had to modify tests for generate_invite_url() in test/tests_util.py in my own local test file to reflect new behavior as it no longer takes in command line arguments.
- You may need to modify it accordingly to remove irrelevant test cases and adjust to new behavior.

Moved invite URL generation to global function within utils/generate_invite_url.py.
Deleted utils/__main__.py and utils/base_utility_function.py.
Removed main() from utils/init.py.
Moved call to generate_invite_url() to startup.py.
    - If main guild not set, invite URL will be outputted and bot will be shutdown.
    - If main guild is set, invite URL will only be outputted if CONSOLE_LOG_LEVEL in environment variable set to DEBUG.
I had to modify tests for generate_invite_url() in test/tests_util.py reflect new behavior as it no longer takes in command line arguments.
    - You may need to modify it accordingly to remove irrelevant test cases and adjust to new behavior.
@codemicro codemicro changed the title Fix Issue #166 Move invite URL generation to on_ready event Apr 14, 2024
@codemicro

codemicro commented Apr 14, 2024

Copy link
Copy Markdown
Member

Closes #166

@codemicro codemicro linked an issue Apr 14, 2024 that may be closed by this pull request

@CarrotManMatt CarrotManMatt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really great work! I really appreciate your contributions🥰

In order for us to merge you changes the unit tests still need to pass here on GitHub, so you'll need to delete some of the unit-tests that are no longer relevant and include that in your pull request.

There are also a few changes I have suggested, let me know if you have any questions.

Comment thread utils/generate_invite_url.py
Comment thread utils/generate_invite_url.py
Comment thread utils/generate_invite_url.py Outdated
Comment thread cogs/startup.py Outdated
Comment thread utils/generate_invite_url.py Outdated
Comment thread utils/generate_invite_url.py Outdated
Comment thread utils/generate_invite_url.py Outdated
@CarrotManMatt CarrotManMatt added good first issue Good for newcomers refactor Improvements to the codebase that do not directly affect users labels Apr 15, 2024
@CarrotManMatt CarrotManMatt merged commit 3f3c1f4 into CSSUoB:main Apr 21, 2024
@CarrotManMatt

Copy link
Copy Markdown
Member

@edwinchan129 Thank you so much for your hard work on this! It looks great, and we appreciate you contributing in the future🥰

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

good first issue Good for newcomers refactor Improvements to the codebase that do not directly affect users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move invite URL generation to on_ready event

3 participants